<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>">

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>学习链接列表</title>
		<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
a {
	color:#000;
	text-decoration: none;
}
a:hover {
	color:#CA5466;
	text-decoration:underline;
}
a img {
	border: 0;
}
.STYLE1 {
	font-size: 13px;
	color: #000;
}

.STYLE3 {
	font-size: 12px;
	font-weight: bold;
}

.STYLE4 {

	font-size: 12px;
}

.td_bg {
	font-size: 13px;
	background: #fff;
	border:1px solid #6495ED;
}

/*表单项的字体格式*/
.td_x_bg {
	font-size: 13px;
	font-weight: bold;
	text-align: center;
	background: #BDE3FB;
	border:1px solid #6495ED;
	height:40px;
}

.table {
	margin-top: 10px;
}
-->
</style>
		<script language="javascript" src="js/jquery.js"></script>
		<script language="javascript" src="js/tdColor.js"></script>
		<script>
			function showwin(tagName) {
				var win = $('#'+ tagName);
				win.fadeIn("slow");
			}
			function hidewin(tagName) {
				var win = $('#'+ tagName);
				win.fadeOut("slow");
			}
		</script>
	</head>

	<body>
		<jsp:include page="resourceAddLink.jsp" flush="true" />
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="30" background="images/main/tab_05.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="30">
								<img src="images/main/tab_03.gif" width="12" height="30" />
							</td>
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="46%" valign="middle">
											<table width="100%" border="0" cellspacing="0"
												cellpadding="0">
												<tr>
													<td width="5%">
														<div align="center">
															<img src="images/main/tb.gif" width="16" height="16" />
														</div>
													</td>
													<td width="95%" class="STYLE1">
														<span class="STYLE3">你当前的位置</span>：[资源共享]-[学习链接列表]
													</td>
												</tr>
											</table>
										</td>
										<td width="54%" align="right">
											<span  class="STYLE1" style="cursor:pointer;" onmouseover="this.style.color='#CA5466';this.style.textDecoration='underline';"
													onmouseout="this.style.color='#000';this.style.textDecoration='none';"
													onclick="showwin('addLink')">
													添加链接
											</span>
											<table border="0" align="right" cellpadding="0"
												cellspacing="0">
												<tr>
													<td width="80">
													</td>
													<td width="60">
														<table width="90%" border="0" cellpadding="0"
															cellspacing="0">
															<tr>
																<td class="STYLE1"></td>
																<td class="STYLE1"></td>
															</tr>
														</table>
													</td>

												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
							<td width="16">
								<img src="images/main/tab_07.gif" width="16" height="30" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="8" background="images/main/tab_12.gif">
								&nbsp;
							</td>
							<td>
								<s:if test="links.size == 0">
									无对应记录
								</s:if>
								<s:else>
								<table width="100%" border="0" cellpadding="0" cellspacing="1"
									bgcolor="#b5d6e6">
									<tr bgcolor="#FFFFFF">
										<td width="45" height="22" background="images/main/bg.gif">
											<div align="center">
												<span class="STYLE1">序号</span>
											</div>
										</td>
										<td height="22" background="images/main/bg.gif">
											<div align="center">
												<span class="STYLE1">链接地址</span>
											</div>
										</td>
										<td width="100" height="22" background="images/main/bg.gif">
											<div align="center">
												<span class="STYLE1">分类</span>
											</div>
										</td>
										<td height="22" background="images/main/bg.gif">
											<div align="center">
												<span class="STYLE1">描述</span>
											</div>
										</td>
										<s:if test="#session.user.post in {3,4}" >
										<td height="22" background="images/main/bg.gif">
											<div align="center">
												<span class="STYLE1">操作</span>
											</div>
										</td>
										</s:if>
									</tr>
									<s:iterator value="links" var="links"  status="status">
									<tr class="changeColor" bgcolor="#FFFFFF"
										style="color: #ff0000">
										<td height="20">
											<div align="center" class="STYLE1">
												<div align="center">
													<span class="STYLE1"><s:property value="#status.count + (page.currentPage-1)*page.pageSize" /></span>
												</div>
											</div>
										</td>
										<td height="20">
											<div align="center">
												<span class="STYLE1">
													<a href="<s:property value="#links.urlPath"/>" target="_blank"><s:property value="#links.urlPath"/></a>
												</span>
											</div>
										</td>
										<td height="20">
											<div align="center">
												<span class="STYLE1">
													<s:if test="#links.urlType == 0">兴趣爱好</s:if>
													<s:elseif test="#links.urlType == 1">Java</s:elseif>
													<s:elseif test="#links.urlType == 2">PHP</s:elseif>
													<s:elseif test="#links.urlType == 3">LINUX</s:elseif>
													<s:elseif test="#links.urlType == 4">数据库</s:elseif>
													<s:else>其它</s:else>
												</span>
											</div>
										</td>
										<td height="20">
											<div align="left">
												<span class="STYLE1">
													<s:property value="#links.description" />
												</span>
											</div>
										</td>
										<s:if test="#session.user.post in {3,4}">
										<td height="20">
											<div align="center" style="padding:0;font-weight:normal;font-size:11px">
												<span class="STYLE1">
													<jsp:include page="resourceModifyLink.jsp" flush="true" />
													<span  class="STYLE1" style="cursor:pointer;background:url(images/main/export.gif) 0 -2px no-repeat;padding-left:16px;" onmouseover="this.style.color='#CA5466';this.style.textDecoration='underline';"
														onmouseout="this.style.color='#000';this.style.textDecoration='none';"
														onclick="parentNode.children['ModifyLink'].style.display='block';">
														修改
													</span>
													<span style="background:url(images/main/del.gif) 0 -2px no-repeat;padding-left:16px;"><a href="front/deleteLink.action?link.id=<s:property value="#links.id"/>" onclick="return confirm('确认删除？');">删除</a></span>
												</span>
											</div>
										</td>
										</s:if>
									</tr>
									</s:iterator>
								</table>
								</s:else>
							</td>
							<td width="8" background="images/main/tab_15.gif">
								&nbsp;
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="35" background="images/main/tab_19.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="35">
								<img src="images/main/tab_18.gif" width="12" height="35" />
							</td>
							<td>
								<form action="front/getLinklist.action" method="get">
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td class="STYLE4">
												&nbsp;&nbsp;共有 <s:property value="page.rowCount" /> 条记录，
												当前第 <s:property value="page.currentPage" /> / <s:property value="page.pageCount" /> 页
											</td>
											<td>
								<s:if test="links.size != 0">
												<table border="0" align="right" cellpadding="0"
													cellspacing="0">
													<tr>
														<td width="40">
															<a href="front/getLinkList.action?page.currentPage=1"><img src="images/main/first.gif"
																	width="37" height="15" border="0" />
															</a>
														</td>
														<s:if test="page.currentPage != 1" >
														<td width="45">
															<a href="front/getLinkList.action?page.currentPage=<s:property value="page.currentPage - 1" />" ><img src="images/main/back.gif"
																	width="43" border="0" height="15" />
															</a>
														</td>
														</s:if>
														<s:if test="page.currentPage != page.pageCount" >
														<td width="45">
															<a href="front/getLinkList.action?page.currentPage=<s:property value="page.currentPage + 1" />" ><img src="images/main/next.gif"
																	width="43" border="0" height="15" />
															</a>
														</td>
														</s:if>
														<td width="40">
															<a href="front/getLinkList.action?page.currentPage=<s:property value="page.pageCount" />" ><img src="images/main/last.gif"
																	border="0" width="37" height="15" />
															</a>
														</td>
														<td width="100">
															<div align="center">
																<span class="STYLE1">转到第 <input name="page.currentPage"
																		type="text" size="4"
																		style="height: 12px; width: 20px; border: 1px solid #999999;" />
																	页 </span>
															</div>
														</td>
														<td width="40">
															<input type="image" src="images/main/go.gif" width="37"
																height="15" />
														</td>
													</tr>
												</table>
								</s:if>
											</td>
										</tr>
									</table>
								</form>
							</td>
							<td width="16">
								<img src="images/main/tab_20.gif" width="16" height="35" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>